3dhall12i2c 2.2.0
Loading...
Searching...
No Matches
3D Hall 12 I2C Click Driver

API for configuring and manipulating 3D Hall 12 I2C Click driver. More...

Topics

 3D Hall 12 I2C Registers List
 List of registers of 3D Hall 12 I2C Click driver.
 3D Hall 12 I2C Registers Settings
 Settings for registers of 3D Hall 12 I2C Click driver.
 3D Hall 12 I2C MikroBUS Map
 MikroBUS pin mapping of 3D Hall 12 I2C Click driver.

Functions

void c3dhall12i2c_cfg_setup (c3dhall12i2c_cfg_t *cfg)
 3D Hall 12 I2C configuration object setup function.
err_t c3dhall12i2c_init (c3dhall12i2c_t *ctx, c3dhall12i2c_cfg_t *cfg)
 3D Hall 12 I2C initialization function.
err_t c3dhall12i2c_default_cfg (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C default configuration function.
err_t c3dhall12i2c_write_reg (c3dhall12i2c_t *ctx, uint8_t reg, uint16_t data_in)
 3D Hall 12 I2C write register function.
err_t c3dhall12i2c_read_reg (c3dhall12i2c_t *ctx, uint8_t reg, uint16_t *data_out)
 3D Hall 12 I2C read register function.
void c3dhall12i2c_set_sample_pin (c3dhall12i2c_t *ctx, uint8_t state)
 3D Hall 12 I2C set sample pin function.
uint8_t c3dhall12i2c_get_int_pin (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C get INT pin function.
void c3dhall12i2c_start_measurement (c3dhall12i2c_t *ctx)
 3D Hall 12 I2C start measurement function.
err_t c3dhall12i2c_read_data (c3dhall12i2c_t *ctx, c3dhall12i2c_data_t *data_out)
 3D Hall 12 I2C read data function.

Detailed Description

API for configuring and manipulating 3D Hall 12 I2C Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ c3dhall12i2c_cfg_setup()

void c3dhall12i2c_cfg_setup ( c3dhall12i2c_cfg_t * cfg)

3D Hall 12 I2C configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See c3dhall12i2c_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ c3dhall12i2c_default_cfg()

err_t c3dhall12i2c_default_cfg ( c3dhall12i2c_t * ctx)

3D Hall 12 I2C default configuration function.

This function executes a default configuration of 3D Hall 12 I2C Click board.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ c3dhall12i2c_get_int_pin()

uint8_t c3dhall12i2c_get_int_pin ( c3dhall12i2c_t * ctx)

3D Hall 12 I2C get INT pin function.

This function reads the state of the INT pin.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ c3dhall12i2c_init()

err_t c3dhall12i2c_init ( c3dhall12i2c_t * ctx,
c3dhall12i2c_cfg_t * cfg )

3D Hall 12 I2C initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See c3dhall12i2c_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c3dhall12i2c_read_data()

err_t c3dhall12i2c_read_data ( c3dhall12i2c_t * ctx,
c3dhall12i2c_data_t * data_out )

3D Hall 12 I2C read data function.

This function reads the temperature, X, Y, Z magnetic field, angle, and magnitude from the device.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
[out]data_out: Pointer to the structure where read data will be stored. See c3dhall12i2c_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
This function performs a measurement trigger before reading the data.

◆ c3dhall12i2c_read_reg()

err_t c3dhall12i2c_read_reg ( c3dhall12i2c_t * ctx,
uint8_t reg,
uint16_t * data_out )

3D Hall 12 I2C read register function.

This function reads a 16-bit data from the specified register.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Pointer to a variable where read data will be stored.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ c3dhall12i2c_set_sample_pin()

void c3dhall12i2c_set_sample_pin ( c3dhall12i2c_t * ctx,
uint8_t state )

3D Hall 12 I2C set sample pin function.

This function sets the state of the SAMPLE pin.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
[in]state: Pin logic state (0 - Low, 1 - High).
Note
None.

◆ c3dhall12i2c_start_measurement()

void c3dhall12i2c_start_measurement ( c3dhall12i2c_t * ctx)

3D Hall 12 I2C start measurement function.

This function triggers a measurement by toggling the SAMPLE pin.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
Note
The SAMPLE pin is toggled from LOW to HIGH with a 1 ms delay between transitions.

◆ c3dhall12i2c_write_reg()

err_t c3dhall12i2c_write_reg ( c3dhall12i2c_t * ctx,
uint8_t reg,
uint16_t data_in )

3D Hall 12 I2C write register function.

This function writes a 16-bit data to the specified register.

Parameters
[in]ctx: Click context object. See c3dhall12i2c_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: 16-bit data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.